From: Owen Rafferty <owenr@fferty.me>
Subject: lvm2: bashism patch
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi, this patch removes the bash make dependency for lvm2. Lines 17-20 of
the build script can of course be deleted. Also probably want to
accumulate the patching into a for loop...

Thanks.

--- LVM2.2.03.08/tools/Makefile.in
+++ LVM2.2.03.08/tools/Makefile.in
@@ -167,31 +167,35 @@
 
 command-count.h: $(srcdir)/command-lines.in Makefile
 	@echo "    [GEN] $@"
-	$(Q) set -o pipefail && \
+	$(Q) \
 	( cat $(top_srcdir)/tools/license.inc && \
 	  echo "/* Do not edit. This file is generated by the Makefile. */" && \
 	  echo -n "#define COMMAND_COUNT " && \
-	  $(GREP) '^ID:' $(srcdir)/command-lines.in | $(WC) -l \
+	  { $(GREP) '^ID:' $(srcdir)/command-lines.in || exit 1; } | \
+	  $(WC) -l \
 	) > $@
 
 cmds.h: $(srcdir)/command-lines.in Makefile
 	@echo "    [GEN] $@"
-	$(Q) set -o pipefail && \
+	$(Q) \
 	( cat $(top_srcdir)/tools/license.inc && \
 	  echo "/* Do not edit. This file is generated by the Makefile. */" && \
 	  echo "cmd(CMD_NONE, none)" && \
-	  $(GREP) '^ID:' $(srcdir)/command-lines.in | $(SORT) -u | $(AWK) '{print "cmd(" $$2 "_CMD, " $$2 ")"}' && \
+	  { $(GREP) '^ID:' $(srcdir)/command-lines.in || exit 1; } | \
+	  { $(SORT) -u || exit 1; } | \
+	  $(AWK) '{print "cmd(" $$2 "_CMD, " $$2 ")"}' && \
 	  echo "cmd(CMD_COUNT, count)" \
 	) > $@
 
 command-lines-input.h: $(srcdir)/command-lines.in Makefile
 	@echo "    [GEN] $@"
-	$(Q) set -o pipefail && \
+	$(Q) \
 	( cat $(top_srcdir)/tools/license.inc && \
 	  echo "/* Do not edit. This file is generated by the Makefile. */" && \
-	  echo -en "const char _command_input[] =\n\n\"" && \
-	  $(EGREP) -v '^#|\-\-\-|^$$' $(srcdir)/command-lines.in | $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \
-	  echo "\\n\";" \
+	  /usr/bin/echo -en "const char _command_input[] =\n\n\"" && \
+	  { $(EGREP) -v '^#|\-\-\-|^$$' $(srcdir)/command-lines.in || exit 1; } | \
+	  $(AWK) 'BEGIN {ORS = "\\n\"\n\""} //' && \
+	  /usr/bin/echo "\\n\";" \
 	) > $@
 
 $(SOURCES:%.c=%.d) $(SOURCES2:%.c=%.d): command-lines-input.h command-count.h cmds.h
